<template>
  <div>
    <!-- 面包屑 -->
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>权限管理</el-breadcrumb-item>
      <el-breadcrumb-item>权限列表</el-breadcrumb-item>
    </el-breadcrumb>
    <!-- 卡片 -->
    <el-card class="box-card">
      <!-- 表格 -->
      <el-table :data="tableData" style="width: 100%">
        <el-table-column type="index" width="150"> </el-table-column>
        <el-table-column prop="authName" label="权限名称" width="250">
        </el-table-column>
        <el-table-column prop="path" label="路径" width="250">
        </el-table-column>
        <el-table-column prop="level" label="权限等级" width="250">
          <template slot-scope="scope">
            <el-tag v-show="scope.row.level == '0'">一级</el-tag>
            <el-tag v-show="scope.row.level == '1'" type="success">二级</el-tag>
            <el-tag v-show="scope.row.level == '2'" type="info">三级</el-tag>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
import { getRightList } from '@/http/api'
export default {
  name: 'rights',
  components: {},
  data() {
    return {
      tableData: []
    }
  },
  created() {
    this.render()
  },
  mounted() {},
  methods: {
    render() {
      getRightList().then((res) => {
        console.log(res)
        this.tableData = res
      })
    }
  }
}
</script>
<style scoped lang="scss">
.breadcrumb {
  margin: 10px 0;
}
</style>
